home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / system / mail / transpor / ifmail23.z / ifmail23 / ifmail / ifcico / wazoo.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-09  |  2.0 KB  |  92 lines

  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <string.h>
  4. #include "lutil.h"
  5. #include "ttyio.h"
  6. #include "session.h"
  7. #include "statetbl.h"
  8. #include "config.h"
  9. #include "emsi.h"
  10.  
  11. extern int made_request;
  12. extern int zmsndfiles(file_list*);
  13. extern int zmrcvfiles(void);
  14. extern file_list *respond_wazoo(char*);
  15.  
  16. extern int rxwazoo(void);
  17. extern int rxwazoo(void)
  18. {
  19.     int rc=0;
  20.     fa_list *eff_remote,tmpl;
  21.     file_list *tosend=NULL,**tmpfl;
  22.  
  23.     debug(10,"start rxwazoo transfer");
  24.     if (emsi_remote_lcodes & NPU)
  25.     {
  26.         loginf("remote requested \"no pickup\", no send");
  27.         eff_remote=NULL;
  28.     }
  29.     else if (emsi_remote_lcodes & PUP)
  30.     {
  31.         loginf("remote requested \"pickup primary\"");
  32.         tmpl.addr=remote->addr;
  33.         tmpl.next=NULL;
  34.         eff_remote=&tmpl;
  35.     }
  36.     else eff_remote=remote;
  37.     tosend=create_filelist(eff_remote,ALL_MAIL,0);
  38.  
  39.     if ((rc=zmrcvfiles()) == 0)
  40.     {
  41.         if ((emsi_local_opts & NRQ) == 0)
  42.         {
  43.             for (tmpfl=&tosend;*tmpfl;tmpfl=&((*tmpfl)->next));
  44.             *tmpfl=respond_wazoo(NULL);
  45.         }
  46.  
  47.         if ((tosend != NULL) || ((emsi_remote_lcodes & NPU) == 0))
  48.             rc=zmsndfiles(tosend);
  49.  
  50.         if ((rc == 0) && (made_request))
  51.         {
  52.             loginf("freq was made, trying to receive files");
  53.             rc=zmrcvfiles();
  54.         }
  55.     }
  56.  
  57.     tidy_filelist(tosend,(rc == 0));
  58.     debug(10,"rxwazoo transfer rc=%d",rc);
  59.     return rc;
  60. }
  61.  
  62. extern int txwazoo(void);
  63. extern int txwazoo(void)
  64. {
  65.     int rc=0;
  66.     file_list *tosend=NULL,*respond=NULL;
  67.     char *nonhold_mail;
  68.  
  69.     debug(10,"start txwazoo transfer");
  70.     if (localoptions & NOHOLD) nonhold_mail=ALL_MAIL;
  71.     else nonhold_mail=NONHOLD_MAIL;
  72.     if (emsi_remote_lcodes & HAT)
  73.     {
  74.         loginf("remote asked to \"hold all traffic\", no send");
  75.         tosend=NULL;
  76.     }
  77.     else tosend=create_filelist(remote,nonhold_mail,0);
  78.  
  79.     if ((tosend != NULL) || ((emsi_remote_lcodes & NPU) == 0))
  80.         rc=zmsndfiles(tosend);
  81.     if (rc == 0)
  82.         if ((rc=zmrcvfiles()) == 0)
  83.             if ((emsi_local_opts & NRQ) == 0)
  84.                 if ((respond=respond_wazoo(NULL)))
  85.                     rc=zmsndfiles(respond);
  86.  
  87.     tidy_filelist(tosend,(rc == 0));
  88.     tidy_filelist(respond,0);
  89.     debug(10,"end txwazoo transfer");
  90.     return rc;
  91. }
  92.